refactor: simplify build to single so without CMakeLists.txt#113
Merged
GuoxiaWang merged 1 commit intoPaddlePaddle:mainfrom Mar 5, 2026
Merged
refactor: simplify build to single so without CMakeLists.txt#113GuoxiaWang merged 1 commit intoPaddlePaddle:mainfrom
GuoxiaWang merged 1 commit intoPaddlePaddle:mainfrom
Conversation
5d4ffd1 to
6124f93
Compare
umiswing
reviewed
Mar 5, 2026
| const bool has_lt_start = lt_start_row_indices.defined(); | ||
| const bool has_lt_end = lt_end_row_indices.defined(); | ||
| const bool has_ut_start = ut_start_row_indices.defined(); | ||
| const bool has_ut_end = ut_end_row_indices.defined(); |
Author
There was a problem hiding this comment.
因为has_lt_start和has_ut_end没用到。在后面会报warnning。
| BUILD_FA3 = FLASHMASK_BUILD in ('fa3', 'all') | ||
| BUILD_FA4 = FLASHMASK_BUILD in ('fa4', 'all') | ||
|
|
||
| VERSION = '4.0+g' + get_git_commit() |
| include_dirs=[ | ||
| 'flash_mask/flashmask_attention_v3/csrc', | ||
| 'flash_mask/flashmask_attention_v3', | ||
| 'flash_mask/flashmask_attention_v3/cutlass/include', |
Member
There was a problem hiding this comment.
后续再接入flashmask v1时,需要看看怎么避免cutlass版本冲突。
| # FLASHMASK_BUILD=fa4 pip install -e . --no-build-isolation | ||
| # FLASHMASK_BUILD=fa3 pip install -e . --no-build-isolation | ||
| # pip install -e . --no-build-isolation # builds all | ||
| # ============================================================ |
Member
There was a problem hiding this comment.
发版时会通过这个方式构建whl
python setup.py bdist_wheel
| @@ -1,292 +0,0 @@ | |||
| cmake_minimum_required(VERSION 3.9 FATAL_ERROR) | |||
| flashmaskv3_clear_fwd_params_handle(params_handle); | ||
| Flash_fwd_params params_obj = {}; | ||
| Flash_fwd_params *params_handle = ¶ms_obj; | ||
| set_flashmaskv3_params_fprop( |
Member
There was a problem hiding this comment.
这个params_handle感觉可以进一步去掉了,接口代码里大部分调用直接用params.member = var这样的方式就行。不过,可以先这样合入一版。
6124f93 to
e4ea622
Compare
e4ea622 to
61caa9d
Compare
umiswing
approved these changes
Mar 5, 2026
| for split in split_suffixes: | ||
| for paged in paged_suffixes: | ||
| for softcap in softcap_fwd_suffixes: | ||
| for packgqa in packgqa_suffixes: |
GuoxiaWang
approved these changes
Mar 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
2步构建(cmake+setup.py)变成 1步(setup.py),删除CMakeLists.txt
2个so合并成1个so,不需要跨so边界调用,删除 C ABI wrapper
FLASHMASK_BUILD=fa4 → 纯 Python 安装,不 import paddle,不编译 CUDA
FLASHMASK_BUILD=fa3 → 只编译 FA3 CUDA 内核,排除 cute/ 包
FLASHMASK_BUILD=all → 默认,两个都装